package com.caowei.weicimpress.weicimpress;

/**
 * Created by caoweiPc on 2014/7/19.
 */
public class FragHandlerHub {

    public static enum CLICKSOURCE{
       NORMAL,ACTIONBAR
    }
    private CLICKSOURCE clickSource=CLICKSOURCE.NORMAL;
    private  UpdateUI updateUI;

    public void execute(Object... objects){
        FileHandler.OperType operType= (FileHandler.OperType) objects[1];
        switch (operType){
            case LIST:
                MyDataList result= (objects[0]!=null)? (MyDataList) objects[0] :null;
                updateUI.updateUI(result,clickSource);
                break;
        }
    }

    public void setUpdateUI(UpdateUI updateUI) {
        this.updateUI = updateUI;
    }


    public interface UpdateUI<T>{
        public  void updateUI(T t,CLICKSOURCE clicksource);
    }

    public CLICKSOURCE getClickSource() {
        return clickSource;
    }

    public void setClickSource(CLICKSOURCE clickSource) {
        this.clickSource = clickSource;
    }
}
